Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix testsuite #504

Merged
merged 13 commits into from
Nov 6, 2024
Merged

Conversation

praiskup
Copy link
Member

@praiskup praiskup commented Oct 3, 2024

No description provided.

@praiskup praiskup force-pushed the praiskup-fix-testsuite branch 6 times, most recently from c04a598 to da31812 Compare October 3, 2024 20:43
runtests.sh Fixed Show fixed Hide fixed
runtests.sh Fixed Show fixed Hide fixed
@praiskup praiskup force-pushed the praiskup-fix-testsuite branch 3 times, most recently from 931ddb1 to a1dc9a4 Compare October 4, 2024 08:23
At least temporarily, if anyone wants to make it working in the future
(I am not motivated enough as we use vcs-diff-lint/python for similar
things).
Mostly wrong import order, useless imports, etc.
- Requires us to add pytest.ini to tell pytest where to look for test
  files, and set the python path.
- Mock drops terminal from the tested code, so we have to "mock" it in
  test_colors()
- Enable coverage in tox tests.
@praiskup praiskup force-pushed the praiskup-fix-testsuite branch from c38c678 to 0754c52 Compare October 4, 2024 08:47
- Some tests can not work at rpmbuild time, because we can not run
  rpmbuild in rpmbuild, and there's no .git/ directory, skip.
- Use 'titodir' below 'srcdir', to not pollute the /tmp/tito dir.
- The test_colors() test requires color-friendly TERM env.
- EL7 is EOL, do not enable tests there.
The Version is more strict, but we only use this for the implementation
of tito.props configuration:

    [requirements]
    tito = <version>

And the tito versions are not anyhow extraordinary.

Note, this is done to fix a tox test failure.
Even Python 2.7 is now EOL.  And this weird import has been breaking
the Tox tests (importing the tagger class brought in other unnecessary
deps and tests bombed).
This is tricky.  Note the sys.path hack in test/unit/__init__.py where
we intentionally use the Fedora's default Python libraries with a
different Python version selected by Tox.  Right now it means that we
use, e.g., python3-rpm compiled for Python 3.12 (F39) with Python 3.7
(which probably works because Tox is executed as root in the tox
container, overwriting the pre-compiled *.pyc files in container).

Some tests need to be skipped in Tox, therefore the skip_if_tox()
method.

Also, the GitHub's action for 'git checkout' provides somewhat
non-standard environment for Tito to work, hence the fix_tox_env()
configuration method.
@praiskup praiskup force-pushed the praiskup-fix-testsuite branch from 5eb436e to b2b5657 Compare October 4, 2024 13:56
@FrostyX FrostyX merged commit e252a4e into rpm-software-management:main Nov 6, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants